@extends('home.layout.index')
@section('link')
	<link type="text/css" rel="stylesheet" href="/homeassets/link/css/link.2012.css" />
<style>
		#ul_ul,.li_li{
			margin:0;
			padding:0;
			list-style: none;
		}

		.li_li{
			width:216px;
			height:40px;
			background: #ccc;
			/*border:1px solid #abc;*/
			text-align:center;
			line-height: 40px;
			float:left;
			cursor:pointer;
		}
		.div_div{
			width:400px;
			height:100%;
			/*border:1px solid #ccc;*/
			display: none;
			float:left;
			padding-left: 30px
		}

	</style>
@endsection
@section('content')
	@if(session('success'))
        <script>
            alert("{{ session('success') }}");
            location.href = '/home/link/index';
        </script>
    @endif
	<div class="w">
		<div class="link_box">
			<div class="link_top"><div class="top_right"></div><div class="top_left"></div></div>	
			<div class="link_content">
				<h3 class="link_tit">友情链接</h3>
				<ul class="link_list">
					@foreach($data as $k=>$v)
						@if($v['state'] == 1)
							@if($v['mode'] == 1)
								<li><img src="/ad/homelink/1.png" style="width:20px;height:20px;margin-right:5px;margin-bottom:-6px" alt=""><a href="{{ $v['url'] }}" target="_blank">{{ $v['words'] }}</a></li>
							@elseif($v['mode'] == 2)
								<li><img src="/ad/homelink/1.png" style="width:20px;height:20px;margin-right:5px;margin-bottom:2px" alt=""><a href="{{ $v['url'] }}" target="_blank"> <img src="{{ $v['image'] }}" alt="" style="width:90px;height:25px;"> </a></li>
							@endif
						@endif
					@endforeach

				</ul>
				 <div class="Pagination">
					<!--翻页-->		
				</div> 
			</div>
			<div class="link_bottom"><div class="bottom_right"></div><div class="bottom_left"></div></div>
		</div>
		<div class="link_box_a">
			<div class="link_top">
				<div class="top_right"></div>
				<div class="top_left"></div>
			</div>
			<div class="link_content">
				<h3 class="link_tit">申请友情链接</h3>
				<ul class="link_step" style="list-style:none">
					<li class="link_step_tit">申请步骤：</li>
					<li>
						<div class="float_Left">
							1.</div>
						<div class="margin_l_12">
							请先在贵网站做好京东的文字友情链接：
							<br /> 链接文字：agoda链接地址：
							<a href="//www.jd.com" target="_blank">www.agoda.com</a></div>
					</li>
					<li>2.做好链接后，请在右侧填写申请信息。京东只接受申请文字友情链接。</li>
					<li>
						<div class="float_Left"> 3.</div>
						<div class="margin_l_12">
							已经开通我站友情链接且内容健康，符合本站友情链接要求的网站，agoda管理员审核后，可以显示在此友情链接页面。</div>
					</li>
					<li>
						<div class="float_Left"> 4.</div>
						<div class="margin_l_12">
							请通过右侧选择申请方式，注明：友情链接申请。</div>
					</li>
					<li>
						<div class="float_Left"> 5.</div>
						<div class="margin_l_12">
							申请成功后，将在24小时内进行审核，通过后将发送邮件，请注意查收！如不通过，将不予以任何回复！</div>
					</li>
				</ul>

				<ul id="ul_ul">
					<li class="li_li" style="border-right:1px solid #bbb">文字申请</li>
					<li class="li_li">图片申请</li>
				</ul>
				<div style="display:block;" class="div_div">
					<form id="frm_submit" method="post" action="/home/link/insert" enctype="multipart/form-data">
						{{ csrf_field() }}
						<!-- 操作结果提示 -->
                    <div class="col-md-12" id="success_s" title="点击隐藏">
                        <div class="card">
                            <div id="success_error" style="display:none;"><strong></strong></div>
                        </div>
                    </div>
                    <div class="col-md-12" id="successs" title="点击隐藏">
                        <div class="card" style="width:432px;margin-left:-30px;color: #a94442;background-color: #f2dede;border-color: #ebccd1;">
                            @if(session('success'))
                                <div class="alert alert-success" >
                                    <strong>
                                        {{ session('success') }}
                                    </strong>
                                </div>
                            @endif
                            @if(session('error'))
                                <div class="">
                                    <strong>
                                        {{ session('error') }}
                                    </strong>
                                </div>
                            @endif
                            @if(count($errors) > 0)
                                <div class="alert alert-danger">
                                    <ul style="list-style:none">
                                        @foreach ($errors->all() as $error)
                                            <li>{{ $error }}</li>
                                        @endforeach
                                    </ul>
                                </div>
                            @endif
                        </div>
                    </div>
						<table cellpadding="0" cellspacing="0" class="link_table" width="309" style="font-size:12px">
							<tr>
								<td height="29">
									手机号：
								</td>
								<td height="29">
									<input id="phone_phone" name="phone" type="text" value="{{ old('phone') }}" class="w247" />
									<span></span>
								</td>
							</tr>
							<tr>
								<td height="29">
									电子邮箱：
								</td>
								<td height="29">
									<input id="email_email" name="email" type="email" value="{{ old('email') }}" class="w247" />
									<span></span>
								</td>
							</tr>
					
					
							<tr>
								<td height="29">
									网站名称：
								</td>
								<td height="29">
									<input id="words" name="words" type="text" value="{{ old('words') }}" class="w247" />
									<span></span>
								</td>
							</tr>
						
							<tr>
								<td height="29">
									网&nbsp;&nbsp;&nbsp;&nbsp;址：
								</td>
								<td height="29">
									<input id="url_url" name="url" type="text" class="w247" value="{{ old('url') }}"/>
									<span></span>
								</td>
							</tr>
							<tr>
								<td height="29">
									开通天数：
								</td>
								<td height="29">
									<input id="timelength_timelength" name="timelength" type="text" value="{{ old('timelength') }}" class="w247" />
									<span></span>
								</td>
							</tr>
							<tr>
								<td width="61" height="29" valign="top">
									网站介绍：
								</td>
								<td width="348" valign="top">
									<textarea id="contents" name="contents" value="{{ old('contents') }}" class="w247h60"></textarea>
									<span></span>
								</td>
							</tr>
							<tr>
								<td height="45" colspan="2" align="center" valign="middle">
									<button type="submit" name="mode" value="1" style="color: #fff; background-color: #31b0d5;font-size: 14px;margin-left:-100px;margin-right:20px;width:100px;height:34px;border-color: #269abc;"> 申请</button>　
		                			<button type="reset" name="mode"  style="color: #fff; background-color: #d9534f;font-size: 14px;width:112px;height:34px;border-color: #d43f3a;"> 重置</button>
								</td>
							</tr>
						</table>
					</form> 
				</div>

				<div class="div_div">
					<form id="frm_submit" method="post" action="/home/link/insert" enctype="multipart/form-data">
						{{ csrf_field() }}
						<!-- 操作结果提示 -->
                    <div class="col-md-12" id="success_s" title="点击隐藏">
                        <div class="card">
                            <div id="success_error" style="display:none;"><strong></strong></div>
                        </div>
                    </div>
                    <div class="col-md-12" id="successs" title="点击隐藏">
                        <div class="card" style="width:432px;margin-left:-30px;color: #a94442;background-color: #f2dede;border-color: #ebccd1;">
                            @if(session('success'))
                                <div class="alert alert-success" >
                                    <strong>
                                        {{ session('success') }}
                                    </strong>
                                </div>
                            @endif
                            @if(session('error'))
                                <div class="alert alert-success">
                                    <strong>
                                        {{ session('error') }}
                                    </strong>
                                </div>
                            @endif
                            @if(count($errors) > 0)
                                <div class="alert alert-danger">
                                    <ul style="list-style:none">
                                        @foreach ($errors->all() as $error)
                                            <li>{{ $error }}</li>
                                        @endforeach
                                    </ul>
                                </div>
                            @endif
                        </div>
                    </div>
						<table cellpadding="0" cellspacing="0" class="link_table" width="309" style="font-size:12px">
							<tr>
								<td height="29">
									手机号：
								</td>
								<td height="29">
									<input id="phone_phone2" name="phone" type="text" value="{{ old('phone') }}" class="w247" />
									<span></span>
								</td>
							</tr>
							<tr>
								<td height="29">
									电子邮箱：
								</td>
								<td height="29">
									<input id="email_email2" name="email" type="email" value="{{ old('email') }}" class="w247" />
									<span></span>
								</td>
							</tr>
					
					
							<tr>
								<td height="29">
									网站图片：
								</td>
								<td height="29">
									<input type="file" id="image_image2" multiple name="image" value="{{ old('image') }}">
								</td>
							</tr>
						
							<tr>
								<td height="29">
									网&nbsp;&nbsp;&nbsp;&nbsp;址：
								</td>
								<td height="29">
									<input id="url_url2" name="url" type="text" class="w247" value="{{ old('url') }}"/>
									<span></span>
								</td>
							</tr>
							<tr>
								<td height="29">
									开通天数：
								</td>
								<td height="29">
									<input id="timelength_timelength2" name="timelength" type="text" value="{{ old('timelength') }}" class="w247" />
									<span></span>
								</td>
							</tr>
							<tr>
								<td width="61" height="29" valign="top">
									网站介绍：
								</td>
								<td width="348" valign="top">
									<textarea id="contents_cotents" name="contents" value="{{ old('contents') }}" class="w247h60"></textarea>
									<span></span>
								</td>
							</tr>
							<tr>
								<td height="45" colspan="2" align="center" valign="middle">
									<button type="submit" name="mode" value="2" style="color: #fff; background-color: #31b0d5;font-size: 14px;margin-left:-100px;margin-right:20px;width:100px;height:34px;border-color: #269abc;"> 申请</button>　
		                			<button type="reset" name="mode"  style="color: #fff; background-color: #d9534f;font-size: 14px;width:112px;height:34px;border-color: #d43f3a;"> 重置</button>
								</td>
							</tr>
						</table>
					</form> 
				</div>
			</div>
			<div class="link_bottom">
				<div class="bottom_right"></div>
				<div class="bottom_left"></div>
			</div>
		</div>
	</div>
	@section('js')
	<!-- 友情链接申请错误信息隐藏特效 --> 
	<script src="/homeassets/link/js/link.js"></script>
	@endsection
@endsection